#include "cpu/exec/template-start.h"
#include "cpu/reg.h"
#define instr jmp

static void do_execute() {
	cpu.eip += op_src->val;
	print_asm(str(instr) " %x", cpu.eip + 1 + DATA_BYTE);
}

make_instr_helper(si)
#if DATA_BYTE == 4
make_helper(jmp_rm_l) {
	int len = decode_rm_l(eip + 1);
	cpu.eip = op_src->val - (len + 1);
	print_asm(str(instr) " *%s", op_src->str);
	return len + 1;
}
make_helper(ljmp) {
    uint32_t offset = instr_fetch(eip + 1, 4);
    uint16_t selector = instr_fetch(eip + 5, 2);
   
    sreg_load(R_CS, selector);
    //指令总长为 1(opcode) + 4(offset) + 2(selector) = 7 
    cpu.eip = offset - 7;
    print_asm("ljmp $0x%x, $0x%x", selector, offset);
    return 7;
}
#endif
#include "cpu/exec/template-end.h"
